<?php 
try{
	$pdo = new PDO('mysql:host=localhost; dbname=exercise', 'root', 'root');
	if(!$pdo) {
		echo "NO";
	}
	else{
		echo "OK";
	}
	$sql = 'insert into user(username, password, email) values(:username,:password,:email)';
	$stmt = $pdo->prepare($sql);
	$username = 'huangbowen1';
	$password = 'huangbowen1';
	$email = 'huangbowen@hb.com';
	$stmt->bindValue(':username', $username);
	$stmt->bindValue(':password', $password);
	$stmt->bindValue(':email', $email);
	$stmt->execute();
	echo $stmt->rowCount();


}catch(PDOException $e) {
	$e->getMessage();
}

 ?>